#ifndef OSCILLOSCOPEWIDGET_H
#define OSCILLOSCOPEWIDGET_H

#include "OscilloscopeWidget_global.h"
#include <QGraphicsWidget>
#include "curvewidget.h"
#include <QHBoxLayout>
#include <QPainterPath>
#include <QGraphicsProxyWidget>
#include <QGraphicsLinearLayout>
#include <QLabel>
#include <QRandomGenerator>
#include <QGraphicsSceneMouseEvent>
#include <QDrag>
#include <QApplication>
#include <QMimeData>
#include <QBitmap>
#include <QDebug>
#include <QGraphicsScene>
#include <QPixmap>




class OSCILLOSCOPEWIDGET_EXPORT OscilloscopeWidget : public QGraphicsWidget
{
    Q_OBJECT
public:
    explicit OscilloscopeWidget(QGraphicsWidget* parent = nullptr);
    void setCurveName(QString name, QFont font);
    void setLabelWidth(int width);
    void setColor(QColor backgroundColor, QColor foregroundColor);
    void setCurvePath(QPainterPath* path);
    void setPos(QPoint point);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);

protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;

private:
    QString m_curveName;
    QLabel* m_nameLabel = nullptr;
    CurveWidget* m_curveWidget = nullptr;
    QPixmap m_pixmap;
    QPoint m_pos;
    // QPainterPath* m_path = nullptr;

};

#endif // OSCILLOSCOPEWIDGET_H
